package com.guess.study.designpattern.factory.abstractfactory.client;

import com.guess.study.designpattern.factory.abstractfactory.factory.ConcreteCreator1;
import com.guess.study.designpattern.factory.abstractfactory.factory.ConcreteCreator2;
import com.guess.study.designpattern.factory.abstractfactory.factory.Creator;
import com.guess.study.designpattern.factory.abstractfactory.product.ProductA;
import com.guess.study.designpattern.factory.abstractfactory.product.ProductB;

/**
 * Created by tianran on 2019-06-10.
 */
public class Client {
    public static void main(String[] args) {
        Creator creator1 = new ConcreteCreator1();

        ProductA productA1 = creator1.createProductA();
        productA1.doSomething();
        productA1.doAnything();

        ProductB productB1 = creator1.createProductB();
        productB1.doSomething();
        productB1.doAnything();

        Creator creator2 = new ConcreteCreator2();

        ProductA productA2 = creator2.createProductA();
        productA2.doSomething();
        productA2.doAnything();

        ProductB productB2 = creator2.createProductB();
        productB2.doSomething();
        productB2.doAnything();
    }
}
